| **************************************************************** | ** MCX BASIC MEMORY MAP | **************************************************************** | ORG $0000 | | *--------------------------------------------------------------- | * 6803 Internals | * 0000 | P1DDR rmb 1 ; Port 1 Data Direction Register 0001 | P2DDR rmb 1 ; Port 2 DDR (5 bits) 0002 | P1DATA rmb 1 ; Port 1 Data Register 0003 | P2DATA rmb 1 ; Port 2 Data (5 bits) 0004 | rmb 4 ; unused RAM 0008 | TCSR rmb 1 ; Timer Status and Control Register 0009 | TIMER rmb 2 ; Free running counter 000B | TOCR rmb 2 ; Timer Output Compare Register 000D | TICR rmb 2 ; Timer Input Capture Register 000F | rmb 1 ; unused RAM 0010 | SERMODE rmb 1 ; Serial port Rate and Mode Control Register 0011 | SERCSR rmb 1 ; Serial port Control and Status Registers 0012 | SERIN rmb 1 ; Serial port Receiver Data Register 0013 | SEROUT rmb 1 ; Serial port Transmit Data Register 0014 | RAMCR rmb 1 ; RAM Control Register 0015 | rmb 11 ; not available (reserved by 6803 CPU) | | *--------------------------------------------------------------- | * Expansion of Direct Page (0020-007F) provided by the MCX128 | * | | * Unused by MCX Basic 0020 | rmb 20 ; unused | | * Temporary workspace for variables used by individual statement handlers 0034 | WRKVAR rmb 14 | | * High Resolution Graphics info 0042 | HORMAX rmb 2 ; maximum horizontal and vertical.. 0044 | VERMAX rmb 2 ; .. coordinates for current operation 0046 | HORDEF rmb 2 ; current horizontal pen position 0048 | VERDEF rmb 2 ; current vertical pen position 004A | HORBEG rmb 2 ; X and Y coordinate values.. 004C | VERBEG rmb 2 ; ..for point and line start operations 004E | HOREND rmb 2 ; X and Y coordinate values.. 0050 | VEREND rmb 2 ; ..for line end operations 0052 | ROWBEG rmb 2 ; storage of row address for working XY point 0054 | PIXCTR rmb 1 ; loop counter during line computation 0055 | SETFLG rmb 1 ; PRESET/PSET flag: 0=PRESET, 1=PSET 0056 | WCOLOR rmb 1 ; working color numner 0057 | ALLCOL rmb 1 ; byte with all encompassed pixels set to working color 0058 | GRMODE rmb 1 ; VDG mode bits corresponding to the current PMODE 0059 | HORBYT rmb 1 ; bytes per row for the current PMODE (bit 7 = Resolution/Color flag) 005A | TEXTCS rmb 1 ; VDG color set value for text screen 005B | GRAFCS rmb 1 ; VDG color set value for graphics screen 005C | VDGCPY rmb 1 ; tracking state for the VDG mode bits (CSS, A/G, GM0-2) 005D | GPGMAX rmb 1 ; highest graphics page number allowed in the configuration 005E | VIDPAG rmb 1 ; the current display page (0 = text screen; 1-n = graphics page) 005F | GRPAGE rmb 1 ; the working graphics page 0060 | GRPBEG rmb 2 ; start address of the working graphics page 0062 | GRPEND rmb 2 ; end address (+1) of working graphics page (sized according to PMODE) 0064 | FORCOL rmb 1 ; default user foreground color for graphics 0065 | BAKCOL rmb 1 ; default user background color for graphics 0066 | ANGLE rmb 1 ; current Angle value for DRAW 0067 | SCALE rmb 1 ; current Scale value for DRAW | | * Current state for PLAY 0068 | DOTVAL rmb 1 ; / number of 1/8 note length extensions 0069 | PLYVOL rmb 1 ; \ volume level 006A | OCTAVE rmb 1 ; octave 006B | NOTELN rmb 1 ; note length 006C | TEMPO rmb 1 ; tempo | | * File I/O variables 006D | FILNUM rmb 1 ; current working file number 006E | FCB1 rmb 2 ; address of the first data file FCB 0070 | FCBCNT rmb 1 ; number of allocated FCBs 0071 | RUNFLG rmb 1 ; / RUN flag (00 = LOAD, >0 = RUN, <0 = CHAIN) 0072 | MRGFLG rmb 1 ; \ MERGE flag (00 = not a MERGE) | | * ON BREAK and ON ERROR info 0073 | BRKFLG rmb 1 ; set to ctrl-C when BREAK detected by INKEY$ 0074 | BRGOTO rmb 2 ; line number for ON BREAK GOTO (0 = none) 0076 | ERGOTO rmb 2 ; line number for ON ERROR GOTO (0 = none) 0078 | ERRLIN rmb 2 ; value for ERRLN 007A | ERRNUM rmb 1 ; value for ERRNO | | * Miscellaneous 007B | IFCTR rmb 1 ; nesting level for IF..THEN..ELSE 007C | TRCFLG rmb 1 ; program trace flag (TRON / TROFF) 007D | PRTSRV rmb 1 ; print to server flag (PRINT ON / OFF) 007E | BNKMOD rmb 1 ; configuration value for the RAM Bank Register (non-video access) 007F | SCNLOK rmb 1 ; a non-zero value locks the SCREEN (prevents auto revert to text) | | | *--------------------------------------------------------------- | * 6803 On-Board RAM | * 0080 | CHARAC rmb 1 ; termination character 1 0081 | ENDCHR rmb 1 ; termination character 2 0082 | TMPLOC rmb 1 ; scratch variable 0083 | DIMFLG rmb 1 ; dimensioning flag (non-zero while in a DIM statement) 0084 | VALTYP rmb 1 ; value type ($00 = numeric, $FF = string) 0085 | TMPFLG rmb 1 ; temporary flag variable (used during Crunch and String Allocation) 0086 | ARYMOD rmb 1 ; array mode flag to force ($01) or disable ($80) array lookups 0087 | INPFLG rmb 1 ; flag to differentiate INPUT from READ 0088 | RELFLG rmb 1 ; relational operator flags 0089 | TMPTR1 rmb 2 ; temporary pointer 1 008B | TMPTR2 rmb 2 ; temporary pointer 2 008D | FPA2 rmb 4 ; floating point accumulator #2 (mantissa only) 0091 | STKSAV rmb 2 ; temporary storage for the stack pointer | | ** | ** Basic Program and Variable allocation pointers | ** 0093 | TXTTAB rmb 2 ; start of Basic program 0095 | VARTAB rmb 2 ; start of simple variables 0097 | ARYTAB rmb 2 ; start of array variables 0099 | ARYEND rmb 2 ; end of array variables (first Free RAM address) 009B | FRETOP rmb 2 ; lower bounds of string space, upper bounds of stack 009D | STRTAB rmb 2 ; pointer to used string space (grows downward) 009F | FRESPC rmb 2 ; string space allocator returns a pointer here 00A1 | MEMSIZ rmb 2 ; highest RAM address used by Basic (adjustable with CLEAR) | | ** | ** Basic Program execution info | ** 00A3 | BRKLIN rmb 2 ; line number where program execution stopped 00A5 | BINVAL rmb 2 ; binary integer value (often used to hold a parsed line number) 00A7 | OLDPTR rmb 2 ; address where program execution stopped (for use by CONT) 00A9 | TINPTR rmb 2 ; temporary storage of parser pointer 00AB | DATLIN rmb 2 ; line number where search for DATA statements is taking place 00AD | DATPTR rmb 2 ; pointer to where a READ statement will start searching for a DATA statement 00AF | DATTMP rmb 2 ; temp storage for INPUT/READ parse pointer 00B1 | VARNAM rmb 2 ; temp storage of variable name 00B3 | VARADR rmb 2 ; temp storage of pointer to variable descriptor 00B5 | VARDES rmb 2 ; pointer to variable's descriptor 00B7 | OPSAVE rmb 2 ; saved pointer to entry in the operator dispatch table 00B9 | RELOPS rmb 1 ; temporary relational operator flag | | ** | ** Floating Point Accumulators 3, 4 and 5 are | ** used mainly as scratch data storage. | ** | FPA3 equ * ; Packed Floating Point Accumulator #3 ($BA-$BE) 00BA | FP3EXP rmb 1 ; exponent of FPA3 00BB | DSTEND rmb 2 ; holds destination end address for upward block move 00BD | SRCEND rmb 2 ; holds source end address for upward block move | | FPA4 equ * ; Packed Floating Point Accumulator #4 ($BF-$C3) | DSTPTR equ * ; destination address for block moves (word) 00BF | FRACNT rmb 1 ; number of digits found on the right side of the decimal point 00C0 | DECFLG rmb 1 ; decimal point flag during ASCII to binary number conversion | SRCPTR equ * ; source address for block moves 00C1 | SCIEXP rmb 1 ; 8 bit exponent value when parsing scientific notation 00C2 | EXPSGN rmb 1 ; sign of exponent when parsing scientific notation 00C3 | rmb 1 ; least significant byte of FPA4 mantissa | | FPA5 equ * ; Packed Floating Point Accumulator #5 ($C4-$C8) 00C4 | FP5EXP rmb 1 ; exponent and packed sign bit for FPA5 00C5 | HISTRD rmb 2 ; descriptor address for 'highest' string during compaction 00C7 | DESPTR rmb 2 | | ** | ** Floating Point Accumulator 0 | ** 00C9 | FP0EXP rmb 1 ; exponent 00CA | FPA0 rmb 4 ; mantissa 00CE | FP0SGN rmb 1 ; sign 00CF | COEFCT rmb 1 ; polynomial coefficient counter 00D0 | STRDES rmb 5 ; temporary string descriptor 00D5 | SFTSGN rmb 1 ; sign data shifted in during de-normalization | | ** | ** Floating Point Accumulator 1 | ** 00D6 | FP1EXP rmb 1 ; exponent 00D7 | FPA1 rmb 4 ; mantissa 00DB | FP1SGN rmb 1 ; sign 00DC | RESSGN rmb 1 ; resulting sign for operation 00DD | FPSBYT rmb 1 ; sub-precision (fifth mantissa byte) 00DE | OUTPTR rmb 2 ; multi-purpose pointer (LIST, string, arrays, polynomial) 00E0 | FLKIND rmb 1 ; ** file kind for server transaction 00E1 | VIDBYT rmb 1 ; ** scratch data byte (usually video related) 00E2 | CURLIN rmb 2 ; current execution line number (-1 = not running) | | ** | ** I/O Device Info | ** 00E4 | DEVCFW rmb 1 ; current output device's tab width 00E5 | DEVLCF rmb 1 ; current output device's last tab column 00E6 | DEVPOS rmb 1 ; current line position on current output device 00E7 | DEVWID rmb 1 ; current output device's line width 00E8 | DEVNUM rmb 1 ; current I/O device number: 0 = Screen, -2 = Printer 00E9 | EOFLAG rmb 1 ; EOF flag for use by CONSOLE IN hooks | 00EA | RSTFLG rmb 1 ; warm start reset flag ($55 permits warm start) | | *--------------------------------------------------------------- | * The front-end of the character parser subroutine is copied here | * from ROM during initialization. It needs to be in RAM because | * it utilizes self-modifying code. When entered at CHRGET the | * routine advances the parse pointer and picks up the next character. | * When entered at CHRGOT the routine re-loads the character got | * by the most recent call to CHRGET. | * 00EB | CHRGET rmb 3 * inc CHRPTR+1 ; increment LSB of parse location 00EE | rmb 2 * bne GETCCH ; branch if no carry 00F0 | rmb 3 * inc CHRPTR ; increment MSB of parse location 00F3 | CHRGOT rmb 1 * lda >nnnn ; load char from parse location (Extended) 00F4 | CHRPTR rmb 2 * ; current parse location 00F6 | rmb 3 * jmp LE1C8 ; goto back-end code in ROM | | ** | ** MCX Basic additions (unused by MicroColor Basic) | ** 00F9 | PLYTMR rmb 2 ; note / pause timer (decremented by timer IRQ) 00FB | TIMINT rmb 2 ; interval for the Timer Out Compare IRQ 00FD | TIMVAL rmb 2 ; current value of TIMER 00FF | FILBNK rmb 1 ; Bank selection value for file block I/O | | * | * Secondary Interrupt Vectors (all are initialized to RTI,$00,$00) | * 0100 | SCIVEC rmb 3 ; SCI 0103 | TOFVEC rmb 3 ; Timer Overflow 0106 | OCFVEC rmb 3 ; Output Compare 0109 | ICFVEC rmb 3 ; Input Capture 010C | IRQVEC rmb 3 ; IRQ1 010F | SWIVEC rmb 3 ; SWI 0112 | NMIVEC rmb 3 ; NMI | 0115 | USRVEC rmb 3 ; USR function vector (JMP ILLFNC) 0118 | RVSEED rmb 4 ; variable random number seed ($4FC75259) 011C | CAPLOK rmb 1 ; keyboard Caps-Lock state ($FF) 011D | DEBDLY rmb 2 ; keyboard debounce delay ($045E) 011F | EXECJP rmb 2 ; default EXEC address (ILLFNC) 0121 | XWMVEC rmb 2 ; warm start vector (WRMSTRT) 0123 | LPTBTD rmb 2 ; printer baud rate delay (118) 0125 | LPTLND rmb 2 ; printer carriage return delay (1) 0127 | LPTCFW rmb 1 ; printer tab width (16) 0128 | LPTLCF rmb 1 ; printer's last tab column (112) 0129 | LPTWID rmb 1 ; printer line width (132) 012A | LPTPOS rmb 1 ; current printer line position (0) 012B | BLNKTM rmb 1 ; cursor blink timer (1) | | * Cassette Timing 012C | CYCPAR rmb 1 ; cassette 1200/2400 Hz cycle partition (21) 012D | CMAXTR rmb 1 ; time limit for a valid cassette transition (26) 012E | TRNPAR rmb 1 ; cassette 1200/2400 Hz transition partition (11) 012F | CLDRSZ rmb 2 ; number of cassette leader bytes to write (128) | | * Keyboard State 0131 | KEYBUF rmb 8 ; keyboard tracking state 0139 | KEYCOL rmb 1 ; current keyboard column number (while polling) 013A | CTRLKY rmb 1 ; state of CONTROL key at last key-down 013B | BRKSTA rmb 1 ; tracking state for the BREAK key | 013C | PIXMSK rmb 1 ; pixel mask for SET, RESET and POINT 013D | SDSPTR rmb 2 ; string descriptor stack pointer 013F | TOPSTR rmb 2 ; pointer to top entry on the string stack 0141 | STRSTK rmb NMSTRS*5 ; space allocated for the string stack 0150 | TOPRAM rmb 2 ; highest RAM address -1 ($4FFE with 4K) 0152 | RNDVAL rmb 4 ; partial product from FP multiplication used as data for RND | | * Cassette File Name Search String 0156 | CFNLEN rmb 1 ; length of cassette file name search string 0157 | CFNSTR rmb 8 ; cassette file name search string buffer | | * Cassette File Name Block Buffer 015F | NAMBLK rmb 8 ; file name 0167 | CFTYPE rmb 1 ; file type ($00 = Basic; $02 = ML; $04 = Array Data) 0168 | ASCFLG rmb 1 ; ASCII file flag ($00 = Binary; $FF = ASCII) 0169 | GAPFLG rmb 1 ; file gaps flag ($00 = continuous; $FF = gaps) 016A | CFEXEC rmb 2 ; EXEC addrress for ML file 016C | LDSIZE rmb 2 ; LOAD address for ML file; SIZE of Basic/Array file | | * Cassette I/O 016E | CLDFLG rmb 1 ; set to $FF inside CLOAD to force a NEW upon error 016F | CASBEG rmb 2 ; start address for cassette file output 0171 | CASEND rmb 2 ; end address for cassette file output 0173 | NOLOAD rmb 1 ; SKIPF flag (prevents loading cassette data into RAM) 0174 | MYSTRY rmb 1 ; mystery flag tested by cassette file scan routine 0175 | BLKTYP rmb 1 ; cassette file block type 0176 | BLKLEN rmb 1 ; cassette file block length 0177 | rmb 1 ; not used 0178 | BLKPTR rmb 2 ; cassette file block pointer 017A | BLKSUM rmb 1 ; cassette file block checksum 017B | CCTERR rmb 1 ; cassette byte counter and error flag 017C | CBITCT rmb 1 ; cassette input bit/phase counter 017D | CASTIM rmb 1 ; cassette signal transition/cylce time 017E | CASPOL rmb 1 ; cassette input polarity (+/-96) | 017F | IKYCOD rmb 1 ; key code discovered during BREAK check (for INKEY$) 0180 | CRSPTR rmb 2 ; cursor Position 0182 | CRSCLR rmb 1 ; cursor color 0183 | ENDFLG rmb 1 ; STOP / END flag: negative = STOP, positive = END 0184 | UNCRFL rmb 1 ; flags byte used to UNCRUNCH a program line | 0185 | RVEC1 rmb 3 ; extension hook for CONSOLE IN 0188 | RVEC2 rmb 3 ; extension hook for CONSOLE OUT 018B | RVEC3 rmb 3 ; extension hook to install Tab and Line settings for output device 018E | RVEC4 rmb 3 ; extension hook for program initialization (NEW,RUN,CLEAR) 0191 | RVEC5 rmb 3 ; extension hook for line input 0194 | RVEC6 rmb 3 ; extension hook for expression terminal evaluator 0197 | RVEC7 rmb 3 ; extension hook for implementing ON ERR GOTO 019A | RVEC8 rmb 3 ; extension hook for additional error messages 019D | RVEC9 rmb 3 ; extension hook for ASCII to FP number conversion 01A0 | RVEC10 rmb 3 ; extension hook for command dispatcher 01A3 | RVEC11 rmb 3 ; extension hook for crunching keywords 01A6 | RVEC12 rmb 3 ; extension hook for uncrunching a token 01A9 | RVEC13 rmb 3 ; extension hook for polling the keyboard 01AC | RVEC14 rmb 3 ; extension hook for interpreting CONTROL key values | 01AF | LNKLSB rmb 1 ; $FF - ensures a non-zero link LSB during program line insertion 01B0 | LINUMB rmb 2 ; the program line number being inserted or deleted 01B2 | LINBUF rmb LBUFMX+2 ; line input buffer 02AE | MOVSTR rmb 1 ; first byte of buffer for a small string to be moved into string space 02AF | STRBUF rmb 16 ; buffer for a small string (typically the output of Number-to-String) 02BF | AUTINT rmb 2 ; AUTO line numbering interval (0 = off) | | WRKSPC equ * ; start of program workspace for Large configuration | GRPAG1 equ $0400 ; start of graphics page 1 for Standard configuration |